package com.jie.server.modules.system.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.jie.server.modules.system.entity.OperLog;
import com.jie.server.modules.system.mapper.OperLogMapper;
import com.jie.server.modules.system.service.IOperLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Arrays;
import java.util.List;

/**
 * @description: 操作日志表Service业务层处理
 * @author: xiaojie
 * @since: 2024/12/13 0013
 */
@Service
public class OperLogServiceImpl  extends ServiceImpl<OperLogMapper, OperLog> implements IOperLogService {

    @Autowired
    private OperLogMapper operLogMapper;

    /**
     * 查询操作日志表
     * @param operId 操作日志表主键
     * @return 操作日志表
     */
    @Override
    public OperLog selectOperLogByOperId(Long operId) {
        return operLogMapper.selectOperLogByOperId(operId);
    }

    /**
     * 查询操作日志表列表
     * @param operLog 操作日志表
     * @return 操作日志表
     */
    @Override
    public List<OperLog> selectOperLogList(OperLog operLog) {
        return operLogMapper.selectOperLogList(operLog);
    }

    /**
     * 新增操作日志表
     * @param operLog 操作日志表
     * @return 结果
     */
    @Override
    public boolean create(OperLog operLog) {
        return save(operLog);
    }

    /**
     * 修改操作日志表
     * @param operLog 操作日志表
     * @return 结果
     */
    @Override
    public boolean updateOperLog(OperLog operLog) {
        return updateById(operLog);
    }

    /**
     * 批量删除操作日志表
     * @param operIds 需要删除的操作日志表主键
     * @return 结果
     */
    @Override
    public int deleteOperLogByOperIds(Long[] operIds) {
        return operLogMapper.deleteBatchIds(Arrays.asList(operIds));
    }

    /**
     * 删除操作日志表信息
     * @param operId 操作日志表主键
     * @return 结果
     */
    @Override
    public int deleteOperLogByOperId(Long operId) {
        return operLogMapper.deleteById(operId);
    }

}
